  ________       __          ________                          ___ ___                __    
 /  _____/______|__| _____   \______ \ _____ __  _  ______    /   |   \  ____   ____ |  | __
/   \  __\_  __ \  |/     \   |    |  \\__  \\ \/ \/ /    \  /    ~    \/  _ \ /  _ \|  |/ /
\    \_\  \  | \/  |  | |  \  |    `   \/ __ \\     /   |  \ \    Y    (  <_> |  <_> )    < 
 \______  /__|  |__|__|_|  / /_______  (____  /\/\_/|___|  /  \___|_  / \____/ \____/|__|_ \
        \/               \/          \/     \/           \/         \/                    \/
    
    Grim Dawn Hook (c) 2015 atom0s [atom0s@live.com]

----------------------------------------------------------------------------------------------------

>> What are addons?

    Addons are Lua scripts that are loaded into the game via the Addons.dll plugin. These scripts
    have access to the GDHook core interfaces that plugins can make use of allowing scripts to
    essentially be, compile-less plugins. (With some limitations of course.)
    
    Addons let you extend the game through the means of Lua scripting.

----------------------------------------------------------------------------------------------------
    
>> What is Lua?

    Lua is a powerful, fast, lightweight, embeddable scripting language.

    Lua combines simple procedural syntax with powerful data description constructs based on 
    associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting 
    bytecode for a register-based virtual machine, and has automatic memory management with 
    incremental garbage collection, making it ideal for configuration, scripting, and rapid 
    prototyping.

    You can read and learn more about Lua at their homepage here: http://www.lua.org/about.html
    
----------------------------------------------------------------------------------------------------

>> New To Lua / Lua Beginners Guide

    Here is a collection of links to help get you started with Lua.
    
    You can find the full Lua manual here: (GDHook makes use of Lua 5.1)
    http://www.lua.org/manual/5.1/
    
    Programming In Lua (EBook): http://www.lua.org/pil/contents.html
    Lua Wiki: http://lua-users.org/wiki/
    Lua Wiki Tutorial List: http://lua-users.org/wiki/TutorialDirectory
    Lua Mailing List: http://www.lua.org/lua-l.html
    Lua Forums: http://forum.luahub.com/
    
    Tips and Tricks / Performance Information
        http://www.lua.org/gems/sample.pdf
        http://lua-users.org/wiki/OptimisationTips
        http://stackoverflow.com/questions/89523/lua-patterns-tips-and-tricks
    
    Metatables    
        http://www.lua.org/pil/13.html
        http://phrogz.net/lua/LearningLua_MetatableEvents.html
        http://phrogz.net/lua/LearningLua_ValuesAndMetatables.html
        http://www.dreamincode.net/forums/topic/175747-lua-metatables-tutorial/
    
    Examples / Tutorials    
        http://lua-users.org/wiki/SampleCode
        http://lua-users.org/wiki/TutorialDirectory

----------------------------------------------------------------------------------------------------

>> Using The Addons Plugin

    The addons plugin can be loaded via the typical plugin load command:
        /load addons
        
    By default, Addons.dll will be automatically loaded via the Default.txt script.
    
    You can use the following commands to interact with the plugin:
        /addon load [name]          - Loads the given addon by its name.
        /addon unload [name]        - Unloads the given addon by its name.
        /addon reload [name]        - Reloads the given addon by its name.
        /addon unloadall            - Unloads all currently loaded addons.
        /addon list                 - Lists all running addons.
        /addon exec [name] [cmd]    - Executes a Lua command inside of the given addons state.

----------------------------------------------------------------------------------------------------

>> Some Basic Addon Information

    Lua creates an object called a state when you begin using it. However, this state is fragile
    and does not offer much protection against errors and problems. Because of this, every single
    addon that you load is ran inside of its own Lua state. By doing this, it helps prevent addons
    from conflicting and causing others to crash. If 1 addon has a problem, it simply is set to an
    error state and no longer receives events. Rather then causing all addons to mess up, only one
    is removed.
    
    However this does come with a drawback. Addons cannot directly communicate with each other.
    
    This is where the libs folder comes in handy. Commonly used functions and such can be placed
    inside of the libs folder allowing all plugins to access them. This does not mean that plugins
    can talk to each other using this folder, it is simply a location where commonly used things can
    be put to allow all addons to access them.
    
    If you land up needing to have addons communicate, you can make use of the command system. Have one
    addon invoke a command to be processed, and in another addon, handle that command.

